package com.marco.ipdata.domain;

/**
 * RequestContentDTO.java
 * Create on 2017/3/23
 * Copyright(c) JD Inc 2017. All Rights Reserved.
 * <pre>
 * 功能说明：此pojo封装请求数据返回的数据
 * </pre>
 */
public class RequestContentDTO {
    private String ip;
    //1：正常返回；2：访问出现异常；
    private Integer code;
    private String result;
    //接口标记位 1:百度
    private Integer source;

    public RequestContentDTO(Builder builder) {
        this.ip = builder.ip;
        this.code = builder.code;
        this.result = builder.result;
        this.source = builder.source;
    }

    public static class Builder {
        private String ip;
        //1：正常返回；2：访问出现异常；
        private Integer code;
        private String result;
        //接口标记位 1:百度
        private Integer source;

        public Builder() {

        }

        public Builder(String ip, Integer code, String result, Integer source) {
            this.ip = ip;
            this.code = code;
            this.result = result;
            this.source = source;
        }

        public Builder ip(String ip) {
            this.ip = ip;
            return this;
        }

        public Builder code(Integer code) {
            this.code = code;
            return this;
        }

        public Builder result(String code) {
            this.result = result;
            return this;
        }

        public Builder source(Integer source) {
            this.source = source;
            return this;
        }

        public RequestContentDTO build() {
            return new RequestContentDTO(this);
        }
    }

    public String getIp() {
        return ip;
    }

    public Integer getCode() {
        return code;
    }

    public String getResult() {
        return result;
    }

    public Integer getSource() {
        return source;
    }
}
